<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script src="./手写promise.js"></script>
  <script>
    let p = new HD((resolve, reject) => {
      // console.log(a);
      // resolve('解决')
      setTimeout(() => {
        reject('错误')
      }, 1000)
      
    }).then(value => {
      console.log(value);
    }, error => {
      console.log(error);
    })
    console.log('aa');
    console.log('bbbbb');
  </script>
  <button style="width: 100px;height: 100px;"></button>
</body>
</html>